package hcn.protocol.brandnew.dengji.menzhenyuyue;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
 * 门诊预约状态信息新增-消息请求 - ODS_02040009
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class LabAbnorResultConfirmRequest extends BaseRequest {

    /**
     * 预约列表
     */
    @XmlElement(name = "Appointments")
    private Appointments appointments;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Appointment {

        /**
         * 预约ID
         */
        @XmlElement(name = "AppointmentId")
        private String appointmentId;
        /**
         * 预约日期时间
         */
        @XmlElement(name = "AppointmentDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date appointmentDateTime;
        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 系统预约时间
         */
        @XmlElement(name = "SystemAppointmentDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date systemAppointmentDateTime;
        /**
         * 系统ID
         */
        @XmlElement(name = "SystemID")
        private String systemID;
        /**
         * 预约状态
         */
        @XmlElement(name = "AppointmentStatus")
        private String appointmentStatus;
        /**
         * 预约状态描述
         */
        @XmlElement(name = "AppointmentStatusDescription")
        private String appointmentStatusDescription;
        /**
         * 医务人员预约时间
         */
        @XmlElement(name = "EmployeeAppointmentDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date employeeAppointmentDateTime;
        /**
         * 预约医务人员工号
         */
        @XmlElement(name = "AppointEmployeeCode")
        private String appointEmployeeCode;
        /**
         * 资源ID
         */
        @XmlElement(name = "ResourcesId")
        private String resourcesId;
        /**
         * 资源时段开始时间
         */
        @XmlElement(name = "ResourceStartDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date resourceStartDateTime;
        /**
         * 资源时段结束时间
         */
        @XmlElement(name = "ResourceEndDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date resourceEndDateTime;
        /**
         * 患者卡号
         */
        @XmlElement(name = "MedicalCardID")
        private String medicalCardID;
        /**
         * 患者手机号码
         */
        @XmlElement(name = "PatientMobile")
        private String patientMobile;
        /**
         * 年龄（岁）
         */
        @XmlElement(name = "Age")
        private Short age;
        /**
         * 监护人证件号
         */
        @XmlElement(name = "GuarderIdCard")
        private String guarderIdCard;
        /**
         * 监护人证件类型
         */
        @XmlElement(name = "GuarderIdCardCode")
        private String guarderIdCardCode;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        @DictionaryMapping(id = "CV02_01_101")
        private String idCardCode;
        /**
         * 监护人姓名
         */
        @XmlElement(name = "GuarderName")
        private String guarderName;
        /**
         * 申请医生
         */
        @XmlElement(name = "RequestDoctor")
        private String requestDoctor;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 医疗机构组织机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 申请机构
         */
        @XmlElement(name = "RequestOrganization")
        private String requestOrganization;
        /**
         * 诊疗卡类型
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 患者主索引
         */
        @XmlElement(name = "PersonIdentifier")
        private String personIdentifier;
        /**
         * 年龄单位
         */
        @XmlElement(name = "AgeUnit")
        private String ageUnit;
        /**
         * 渠道编号
         */
        @XmlElement(name = "ChannelCode")
        private String channelCode;
        /**
         * 患者地址
         */
        @XmlElement(name = "PatientAddress")
        private String patientAddress;
        /**
         * 剩余号源数
         */
        @XmlElement(name = "RemainNumber")
        private Integer remainNumber;
        /**
         * 医生排班流水号（排班标识）
         */
        @XmlElement(name = "ScheduleMark")
        private String scheduleMark;
        /**
         * 剩余号数
         */
        @XmlElement(name = "RemainingQuantity")
        private Integer remainingQuantity;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Appointments {

        /**
         * 预约信息
         */
        @XmlElement(name = "Appointment")
        private Appointment appointment;
    }

}
